.class public Lcom/htc/android/footprints/utils/camera/FootprintImageManager;
.super Ljava/lang/Object;
.source "FootprintImageManager.java"


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lcom/htc/android/footprints/utils/camera/FootprintImageManager$FastBitmapDrawable;
    }
.end annotation


# static fields
.field private static final DEBUG:Z = false

.field private static final TAG:Ljava/lang/String; = "FootprintImageManager"

.field private static sInstance:Lcom/htc/android/footprints/utils/camera/FootprintImageManager;

.field private static volatile sScaleMatrix:Landroid/graphics/Matrix;

.field private static sStorageURI:Landroid/net/Uri;


# instance fields
.field public cachedMap:Ljava/util/Map;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/Map",
            "<",
            "Ljava/lang/String;",
            "Lcom/htc/android/footprints/utils/camera/FootprintImageManager$FastBitmapDrawable;",
            ">;"
        }
    .end annotation
.end field

.field private projection:[Ljava/lang/String;


# direct methods
.method static constructor <clinit>()V
    .locals 1

    .prologue
    .line 46
    sget-object v0, Landroid/provider/MediaStore$Images$Media;->EXTERNAL_CONTENT_URI:Landroid/net/Uri;

    sput-object v0, Lcom/htc/android/footprints/utils/camera/FootprintImageManager;->sStorageURI:Landroid/net/Uri;

    .line 48
    const/4 v0, 0x0

    sput-object v0, Lcom/htc/android/footprints/utils/camera/FootprintImageManager;->sInstance:Lcom/htc/android/footprints/utils/camera/FootprintImageManager;

    return-void
.end method

.method public constructor <init>()V
    .locals 3

    .prologue
    .line 38
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 53
    new-instance v0, Ljava/util/HashMap;

    invoke-direct {v0}, Ljava/util/HashMap;-><init>()V

    invoke-static {v0}, Ljava/util/Collections;->synchronizedMap(Ljava/util/Map;)Ljava/util/Map;

    move-result-object v0

    iput-object v0, p0, Lcom/htc/android/footprints/utils/camera/FootprintImageManager;->cachedMap:Ljava/util/Map;

    .line 481
    const/4 v0, 0x4

    new-array v0, v0, [Ljava/lang/String;

    const/4 v1, 0x0

    const-string v2, "_id"

    aput-object v2, v0, v1

    const/4 v1, 0x1

    const-string v2, "_display_name"

    aput-object v2, v0, v1

    const/4 v1, 0x2

    const-string v2, "_data"

    aput-object v2, v0, v1

    const/4 v1, 0x3

    const-string v2, "date_added"

    aput-object v2, v0, v1

    iput-object v0, p0, Lcom/htc/android/footprints/utils/camera/FootprintImageManager;->projection:[Ljava/lang/String;

    .line 620
    return-void
.end method

.method private static checkFsWritable()Z
    .locals 7

    .prologue
    const/4 v6, 0x0

    .line 302
    new-instance v4, Ljava/lang/StringBuilder;

    invoke-direct {v4}, Ljava/lang/StringBuilder;-><init>()V

    invoke-static {}, Landroid/os/Environment;->getExternalStorageDirectory()Ljava/io/File;

    move-result-object v5

    invoke-virtual {v5}, Ljava/io/File;->toString()Ljava/lang/String;

    move-result-object v5

    invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v4

    const-string v5, "/.footprints/thumbnails"

    invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v4

    invoke-virtual {v4}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    .line 305
    .local v1, directoryName:Ljava/lang/String;
    new-instance v0, Ljava/io/File;

    invoke-direct {v0, v1}, Ljava/io/File;-><init>(Ljava/lang/String;)V

    .line 306
    .local v0, directory:Ljava/io/File;
    invoke-virtual {v0}, Ljava/io/File;->isDirectory()Z

    move-result v4

    if-nez v4, :cond_0

    .line 307
    invoke-virtual {v0}, Ljava/io/File;->mkdirs()Z

    move-result v4

    if-nez v4, :cond_0

    move v4, v6

    .line 321
    :goto_0
    return v4

    .line 311
    :cond_0
    new-instance v3, Ljava/io/File;

    const-string v4, ".probe"

    invoke-direct {v3, v1, v4}, Ljava/io/File;-><init>(Ljava/lang/String;Ljava/lang/String;)V

    .line 314
    .local v3, f:Ljava/io/File;
    :try_start_0
    invoke-virtual {v3}, Ljava/io/File;->exists()Z

    move-result v4

    if-eqz v4, :cond_1

    .line 315
    invoke-virtual {v3}, Ljava/io/File;->delete()Z

    .line 317
    :cond_1
    invoke-virtual {v3}, Ljava/io/File;->createNewFile()Z

    move-result v4

    if-nez v4, :cond_2

    move v4, v6

    goto :goto_0

    .line 318
    :cond_2
    invoke-virtual {v3}, Ljava/io/File;->delete()Z
    :try_end_0
    .catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_0

    .line 319
    const/4 v4, 0x1

    goto :goto_0

    .line 320
    :catch_0
    move-exception v4

    move-object v2, v4

    .local v2, ex:Ljava/io/IOException;
    move v4, v6

    .line 321
    goto :goto_0
.end method

.method private static computeSampleSize(Landroid/graphics/BitmapFactory$Options;I)I
    .locals 7
    .parameter "options"
    .parameter "target"

    .prologue
    const/4 v6, 0x1

    .line 91
    iget v4, p0, Landroid/graphics/BitmapFactory$Options;->outWidth:I

    .line 92
    .local v4, w:I
    iget v3, p0, Landroid/graphics/BitmapFactory$Options;->outHeight:I

    .line 94
    .local v3, h:I
    div-int v2, v4, p1

    .line 95
    .local v2, candidateW:I
    div-int v1, v3, p1

    .line 96
    .local v1, candidateH:I
    invoke-static {v2, v1}, Ljava/lang/Math;->max(II)I

    move-result v0

    .line 98
    .local v0, candidate:I
    if-nez v0, :cond_0

    move v5, v6

    .line 112
    :goto_0
    return v5

    .line 100
    :cond_0
    if-le v0, v6, :cond_1

    .line 101
    if-le v4, p1, :cond_1

    div-int v5, v4, v0

    if-ge v5, p1, :cond_1

    add-int/lit8 v0, v0, -0x1

    .line 104
    :cond_1
    if-le v0, v6, :cond_2

    .line 105
    if-le v3, p1, :cond_2

    div-int v5, v3, v0

    if-ge v5, p1, :cond_2

    add-int/lit8 v0, v0, -0x1

    :cond_2
    move v5, v0

    .line 112
    goto :goto_0
.end method

.method public static copyBitmap(Landroid/graphics/Bitmap;Landroid/graphics/Bitmap;IIIILandroid/graphics/Matrix;Z)Landroid/graphics/Bitmap;
    .locals 4
    .parameter "destBitmap"
    .parameter "source"
    .parameter "x"
    .parameter "y"
    .parameter "width"
    .parameter "height"
    .parameter "m"
    .parameter "filter"

    .prologue
    .line 672
    move v0, p4

    .line 673
    .local v0, neww:I
    move v0, p5

    .line 674
    .local v0, newh:I
    new-instance v0, Landroid/graphics/Canvas;

    .end local v0           #newh:I
    invoke-direct {v0}, Landroid/graphics/Canvas;-><init>()V

    .line 677
    .local v0, canvas:Landroid/graphics/Canvas;
    new-instance v1, Landroid/graphics/Rect;

    add-int v2, p2, p4

    add-int v3, p3, p5

    invoke-direct {v1, p2, p3, v2, v3}, Landroid/graphics/Rect;-><init>(IIII)V

    .line 678
    .local v1, srcR:Landroid/graphics/Rect;
    new-instance p3, Landroid/graphics/RectF;

    .end local p3
    const/4 p2, 0x0

    const/4 v2, 0x0

    int-to-float p4, p4

    int-to-float p5, p5

    invoke-direct {p3, p2, v2, p4, p5}, Landroid/graphics/RectF;-><init>(FFFF)V

    .line 685
    .end local p2
    .end local p4
    .end local p5
    .local p3, dstR:Landroid/graphics/RectF;
    new-instance p2, Landroid/graphics/RectF;

    invoke-direct {p2}, Landroid/graphics/RectF;-><init>()V

    .line 686
    .local p2, deviceR:Landroid/graphics/RectF;
    invoke-virtual {p6, p2, p3}, Landroid/graphics/Matrix;->mapRect(Landroid/graphics/RectF;Landroid/graphics/RectF;)Z

    .line 687
    invoke-virtual {p2}, Landroid/graphics/RectF;->width()F

    move-result p4

    invoke-static {p4}, Ljava/lang/Math;->round(F)I

    move-result p5

    .line 688
    .local p5, neww:I
    invoke-virtual {p2}, Landroid/graphics/RectF;->height()F

    move-result p4

    invoke-static {p4}, Ljava/lang/Math;->round(F)I

    move-result p4

    .line 690
    .local p4, newh:I
    iget v2, p2, Landroid/graphics/RectF;->left:F

    neg-float v2, v2

    iget p2, p2, Landroid/graphics/RectF;->top:F

    .end local p2           #deviceR:Landroid/graphics/RectF;
    neg-float p2, p2

    invoke-virtual {v0, v2, p2}, Landroid/graphics/Canvas;->translate(FF)V

    .line 691
    invoke-virtual {v0, p6}, Landroid/graphics/Canvas;->concat(Landroid/graphics/Matrix;)V

    .line 692
    new-instance p2, Landroid/graphics/Paint;

    invoke-direct {p2}, Landroid/graphics/Paint;-><init>()V

    .line 693
    .local p2, paint:Landroid/graphics/Paint;
    invoke-virtual {p2, p7}, Landroid/graphics/Paint;->setFilterBitmap(Z)V

    .line 694
    invoke-virtual {p6}, Landroid/graphics/Matrix;->rectStaysRect()Z

    move-result p6

    .end local p6
    if-nez p6, :cond_0

    .line 695
    const/4 p6, 0x1

    invoke-virtual {p2, p6}, Landroid/graphics/Paint;->setAntiAlias(Z)V

    .line 697
    :cond_0
    if-nez p0, :cond_1

    .line 698
    sget-object p0, Landroid/graphics/Bitmap$Config;->RGB_565:Landroid/graphics/Bitmap$Config;

    .end local p0
    invoke-static {p5, p4, p0}, Landroid/graphics/Bitmap;->createBitmap(IILandroid/graphics/Bitmap$Config;)Landroid/graphics/Bitmap;

    move-result-object p0

    .line 702
    .restart local p0
    :cond_1
    invoke-virtual {v0, p0}, Landroid/graphics/Canvas;->setBitmap(Landroid/graphics/Bitmap;)V

    .line 703
    invoke-virtual {v0, p1, v1, p3, p2}, Landroid/graphics/Canvas;->drawBitmap(Landroid/graphics/Bitmap;Landroid/graphics/Rect;Landroid/graphics/RectF;Landroid/graphics/Paint;)V

    .line 705
    return-object p0
.end method

.method public static createScaledBitmap(Landroid/graphics/Bitmap;Landroid/graphics/Bitmap;IIZ)Landroid/graphics/Bitmap;
    .locals 11
    .parameter "dest"
    .parameter "src"
    .parameter "dstWidth"
    .parameter "dstHeight"
    .parameter "filter"

    .prologue
    const/4 v2, 0x0

    .line 710
    const/4 v6, 0x0

    .line 711
    .local v6, m:Landroid/graphics/Matrix;
    const-class v0, Landroid/graphics/Bitmap;

    monitor-enter v0

    .line 713
    :try_start_0
    sget-object v6, Lcom/htc/android/footprints/utils/camera/FootprintImageManager;->sScaleMatrix:Landroid/graphics/Matrix;

    .line 714
    const/4 v1, 0x0

    sput-object v1, Lcom/htc/android/footprints/utils/camera/FootprintImageManager;->sScaleMatrix:Landroid/graphics/Matrix;

    .line 715
    monitor-exit v0
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    .line 717
    if-nez v6, :cond_0

    .line 718
    new-instance v6, Landroid/graphics/Matrix;

    .end local v6           #m:Landroid/graphics/Matrix;
    invoke-direct {v6}, Landroid/graphics/Matrix;-><init>()V

    .line 721
    .restart local v6       #m:Landroid/graphics/Matrix;
    :cond_0
    invoke-virtual {p1}, Landroid/graphics/Bitmap;->getWidth()I

    move-result v4

    .line 722
    .local v4, width:I
    invoke-virtual {p1}, Landroid/graphics/Bitmap;->getHeight()I

    move-result v5

    .line 723
    .local v5, height:I
    int-to-float v0, p2

    int-to-float v1, v4

    div-float v9, v0, v1

    .line 724
    .local v9, sx:F
    int-to-float v0, p3

    int-to-float v1, v5

    div-float v10, v0, v1

    .line 725
    .local v10, sy:F
    invoke-virtual {v6, v9, v10}, Landroid/graphics/Matrix;->setScale(FF)V

    move-object v0, p0

    move-object v1, p1

    move v3, v2

    move v7, p4

    .line 726
    invoke-static/range {v0 .. v7}, Lcom/htc/android/footprints/utils/camera/FootprintImageManager;->copyBitmap(Landroid/graphics/Bitmap;Landroid/graphics/Bitmap;IIIILandroid/graphics/Matrix;Z)Landroid/graphics/Bitmap;

    move-result-object v8

    .line 728
    .local v8, b:Landroid/graphics/Bitmap;
    const-class v0, Lcom/htc/android/footprints/utils/camera/FootprintImageManager;

    monitor-enter v0

    .line 730
    :try_start_1
    sget-object v1, Lcom/htc/android/footprints/utils/camera/FootprintImageManager;->sScaleMatrix:Landroid/graphics/Matrix;

    if-nez v1, :cond_1

    .line 731
    sput-object v6, Lcom/htc/android/footprints/utils/camera/FootprintImageManager;->sScaleMatrix:Landroid/graphics/Matrix;

    .line 733
    :cond_1
    monitor-exit v0
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_1

    .line 735
    return-object v8

    .line 715
    .end local v4           #width:I
    .end local v5           #height:I
    .end local v8           #b:Landroid/graphics/Bitmap;
    .end local v9           #sx:F
    .end local v10           #sy:F
    :catchall_0
    move-exception v1

    :try_start_2
    monitor-exit v0
    :try_end_2
    .catchall {:try_start_2 .. :try_end_2} :catchall_0

    throw v1

    .line 733
    .restart local v4       #width:I
    .restart local v5       #height:I
    .restart local v8       #b:Landroid/graphics/Bitmap;
    .restart local v9       #sx:F
    .restart local v10       #sy:F
    :catchall_1
    move-exception v1

    :try_start_3
    monitor-exit v0
    :try_end_3
    .catchall {:try_start_3 .. :try_end_3} :catchall_1

    throw v1
.end method

.method public static getDirectory()Ljava/lang/String;
    .locals 2

    .prologue
    .line 78
    new-instance v0, Ljava/lang/StringBuilder;

    invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V

    invoke-static {}, Lcom/htc/android/footprints/utils/camera/FootprintImageManager;->getExternalStorageDirectory()Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    const-string v1, "/.footprints/thumbnails"

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    return-object v0
.end method

.method public static getExternalStorageDirectory()Ljava/lang/String;
    .locals 1

    .prologue
    .line 70
    invoke-static {}, Landroid/os/Environment;->getExternalStorageDirectory()Ljava/io/File;

    move-result-object v0

    invoke-virtual {v0}, Ljava/io/File;->getAbsolutePath()Ljava/lang/String;

    move-result-object v0

    return-object v0
.end method

.method public static getFootprintsDirectory()Ljava/lang/String;
    .locals 2

    .prologue
    .line 74
    new-instance v0, Ljava/lang/StringBuilder;

    invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V

    invoke-static {}, Lcom/htc/android/footprints/utils/camera/FootprintImageManager;->getExternalStorageDirectory()Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    sget-object v1, Ljava/io/File;->separator:Ljava/lang/String;

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    const-string v1, ".footprints"

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    return-object v0
.end method

.method public static getInstance()Lcom/htc/android/footprints/utils/camera/FootprintImageManager;
    .locals 1

    .prologue
    .line 63
    sget-object v0, Lcom/htc/android/footprints/utils/camera/FootprintImageManager;->sInstance:Lcom/htc/android/footprints/utils/camera/FootprintImageManager;

    if-nez v0, :cond_0

    .line 64
    new-instance v0, Lcom/htc/android/footprints/utils/camera/FootprintImageManager;

    invoke-direct {v0}, Lcom/htc/android/footprints/utils/camera/FootprintImageManager;-><init>()V

    sput-object v0, Lcom/htc/android/footprints/utils/camera/FootprintImageManager;->sInstance:Lcom/htc/android/footprints/utils/camera/FootprintImageManager;

    .line 66
    :cond_0
    sget-object v0, Lcom/htc/android/footprints/utils/camera/FootprintImageManager;->sInstance:Lcom/htc/android/footprints/utils/camera/FootprintImageManager;

    return-object v0
.end method

.method public static hasStorage()Z
    .locals 1

    .prologue
    .line 326
    const/4 v0, 0x1

    invoke-static {v0}, Lcom/htc/android/footprints/utils/camera/FootprintImageManager;->hasStorage(Z)Z

    move-result v0

    return v0
.end method

.method public static hasStorage(Z)Z
    .locals 4
    .parameter "requireWriteAccess"

    .prologue
    const/4 v3, 0x1

    .line 336
    invoke-static {}, Landroid/os/Environment;->getExternalStorageState()Ljava/lang/String;

    move-result-object v0

    .line 338
    .local v0, state:Ljava/lang/String;
    const-string v2, "mounted"

    invoke-virtual {v2, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v2

    if-eqz v2, :cond_1

    .line 339
    if-eqz p0, :cond_0

    .line 340
    invoke-static {}, Lcom/htc/android/footprints/utils/camera/FootprintImageManager;->checkFsWritable()Z

    move-result v1

    .local v1, writable:Z
    move v2, v1

    .line 350
    .end local v1           #writable:Z
    :goto_0
    return v2

    :cond_0
    move v2, v3

    .line 344
    goto :goto_0

    .line 346
    :cond_1
    if-nez p0, :cond_2

    const-string v2, "mounted_ro"

    invoke-virtual {v2, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v2

    if-eqz v2, :cond_2

    move v2, v3

    .line 348
    goto :goto_0

    .line 350
    :cond_2
    const/4 v2, 0x0

    goto :goto_0
.end method

.method public static query(Landroid/content/Context;Landroid/net/Uri;[Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;)Landroid/database/Cursor;
    .locals 8
    .parameter "context"
    .parameter "uri"
    .parameter "projection"
    .parameter "selection"
    .parameter "selectionArgs"
    .parameter "sortOrder"

    .prologue
    const/4 v7, 0x0

    .line 356
    :try_start_0
    invoke-virtual {p0}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v0

    .line 357
    .local v0, resolver:Landroid/content/ContentResolver;
    if-nez v0, :cond_0

    move-object v1, v7

    .line 363
    .end local v0           #resolver:Landroid/content/ContentResolver;
    :goto_0
    return-object v1

    .restart local v0       #resolver:Landroid/content/ContentResolver;
    :cond_0
    move-object v1, p1

    move-object v2, p2

    move-object v3, p3

    move-object v4, p4

    move-object v5, p5

    .line 360
    invoke-virtual/range {v0 .. v5}, Landroid/content/ContentResolver;->query(Landroid/net/Uri;[Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;)Landroid/database/Cursor;
    :try_end_0
    .catch Ljava/lang/UnsupportedOperationException; {:try_start_0 .. :try_end_0} :catch_0

    move-result-object v1

    goto :goto_0

    .line 362
    .end local v0           #resolver:Landroid/content/ContentResolver;
    :catch_0
    move-exception v1

    move-object v6, v1

    .local v6, ex:Ljava/lang/UnsupportedOperationException;
    move-object v1, v7

    .line 363
    goto :goto_0
.end method

.method public static roundOrientation(I)I
    .locals 3
    .parameter "orientationInput"

    .prologue
    .line 275
    move v0, p0

    .line 276
    .local v0, orientation:I
    const/4 v2, -0x1

    if-ne v0, v2, :cond_0

    const/4 v0, 0x0

    .line 278
    :cond_0
    rem-int/lit16 v0, v0, 0x168

    .line 280
    const/16 v2, 0x2d

    if-ge v0, v2, :cond_1

    .line 281
    const/4 v1, 0x0

    .line 294
    .local v1, retVal:I
    :goto_0
    return v1

    .line 282
    .end local v1           #retVal:I
    :cond_1
    const/16 v2, 0x87

    if-ge v0, v2, :cond_2

    .line 283
    const/16 v1, 0x5a

    .restart local v1       #retVal:I
    goto :goto_0

    .line 284
    .end local v1           #retVal:I
    :cond_2
    const/16 v2, 0xe1

    if-ge v0, v2, :cond_3

    .line 285
    const/16 v1, 0xb4

    .restart local v1       #retVal:I
    goto :goto_0

    .line 286
    .end local v1           #retVal:I
    :cond_3
    const/16 v2, 0x13b

    if-ge v0, v2, :cond_4

    .line 287
    const/16 v1, 0x10e

    .restart local v1       #retVal:I
    goto :goto_0

    .line 289
    .end local v1           #retVal:I
    :cond_4
    const/4 v1, 0x0

    .restart local v1       #retVal:I
    goto :goto_0
.end method


# virtual methods
.method public addImage(Landroid/content/ContentResolver;Ljava/lang/String;Ljava/lang/String;JLandroid/location/Location;ILjava/lang/String;Ljava/lang/String;)Landroid/net/Uri;
    .locals 11
    .parameter "cr"
    .parameter "imageName"
    .parameter "description"
    .parameter "dateTaken"
    .parameter "location"
    .parameter "orientation"
    .parameter "directory"
    .parameter "filename"

    .prologue
    .line 220
    new-instance v7, Landroid/content/ContentValues;

    const/4 v8, 0x7

    invoke-direct {v7, v8}, Landroid/content/ContentValues;-><init>(I)V

    .line 221
    .local v7, values:Landroid/content/ContentValues;
    const-string v8, "title"

    invoke-virtual {v7, v8, p2}, Landroid/content/ContentValues;->put(Ljava/lang/String;Ljava/lang/String;)V

    .line 222
    const-string v8, "_display_name"

    new-instance v9, Ljava/lang/StringBuilder;

    invoke-direct {v9}, Ljava/lang/StringBuilder;-><init>()V

    invoke-virtual {v9, p2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v9

    const-string v10, ".jpg"

    invoke-virtual {v9, v10}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v9

    invoke-virtual {v9}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v9

    invoke-virtual {v7, v8, v9}, Landroid/content/ContentValues;->put(Ljava/lang/String;Ljava/lang/String;)V

    .line 223
    const-string v8, "description"

    invoke-virtual {v7, v8, p3}, Landroid/content/ContentValues;->put(Ljava/lang/String;Ljava/lang/String;)V

    .line 224
    const-string v8, "datetaken"

    invoke-static/range {p4 .. p5}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;

    move-result-object v9

    invoke-virtual {v7, v8, v9}, Landroid/content/ContentValues;->put(Ljava/lang/String;Ljava/lang/Long;)V

    .line 225
    const-string v8, "mime_type"

    const-string v9, "image/jpeg"

    invoke-virtual {v7, v8, v9}, Landroid/content/ContentValues;->put(Ljava/lang/String;Ljava/lang/String;)V

    .line 226
    const-string v8, "orientation"

    invoke-static/range {p7 .. p7}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v9

    invoke-virtual {v7, v8, v9}, Landroid/content/ContentValues;->put(Ljava/lang/String;Ljava/lang/Integer;)V

    .line 228
    new-instance v3, Ljava/io/File;

    move-object v0, v3

    move-object/from16 v1, p8

    invoke-direct {v0, v1}, Ljava/io/File;-><init>(Ljava/lang/String;)V

    .line 229
    .local v3, parentFile:Ljava/io/File;
    invoke-virtual {v3}, Ljava/io/File;->exists()Z

    move-result v8

    if-nez v8, :cond_0

    invoke-virtual {v3}, Ljava/io/File;->mkdirs()Z

    .line 231
    :cond_0
    invoke-virtual {v3}, Ljava/io/File;->toString()Ljava/lang/String;

    move-result-object v8

    invoke-virtual {v8}, Ljava/lang/String;->toLowerCase()Ljava/lang/String;

    move-result-object v4

    .line 232
    .local v4, path:Ljava/lang/String;
    invoke-virtual {v3}, Ljava/io/File;->getName()Ljava/lang/String;

    move-result-object v8

    invoke-virtual {v8}, Ljava/lang/String;->toLowerCase()Ljava/lang/String;

    move-result-object v2

    .line 234
    .local v2, name:Ljava/lang/String;
    const-string v8, "bucket_id"

    invoke-virtual {v4}, Ljava/lang/String;->hashCode()I

    move-result v9

    invoke-static {v9}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v9

    invoke-virtual {v7, v8, v9}, Landroid/content/ContentValues;->put(Ljava/lang/String;Ljava/lang/Integer;)V

    .line 235
    const-string v8, "bucket_display_name"

    invoke-virtual {v7, v8, v2}, Landroid/content/ContentValues;->put(Ljava/lang/String;Ljava/lang/String;)V

    .line 237
    if-eqz p6, :cond_1

    .line 238
    const-string v8, "latitude"

    invoke-virtual/range {p6 .. p6}, Landroid/location/Location;->getLatitude()D

    move-result-wide v9

    invoke-static {v9, v10}, Ljava/lang/Double;->valueOf(D)Ljava/lang/Double;

    move-result-object v9

    invoke-virtual {v7, v8, v9}, Landroid/content/ContentValues;->put(Ljava/lang/String;Ljava/lang/Double;)V

    .line 239
    const-string v8, "longitude"

    invoke-virtual/range {p6 .. p6}, Landroid/location/Location;->getLongitude()D

    move-result-wide v9

    invoke-static {v9, v10}, Ljava/lang/Double;->valueOf(D)Ljava/lang/Double;

    move-result-object v9

    invoke-virtual {v7, v8, v9}, Landroid/content/ContentValues;->put(Ljava/lang/String;Ljava/lang/Double;)V

    .line 242
    :cond_1
    if-eqz p8, :cond_2

    if-eqz p9, :cond_2

    .line 243
    new-instance v8, Ljava/lang/StringBuilder;

    invoke-direct {v8}, Ljava/lang/StringBuilder;-><init>()V

    move-object v0, v8

    move-object/from16 v1, p8

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v8

    sget-object v9, Ljava/io/File;->separator:Ljava/lang/String;

    invoke-virtual {v8, v9}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v8

    move-object v0, v8

    move-object/from16 v1, p9

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v8

    invoke-virtual {v8}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v6

    .line 244
    .local v6, value:Ljava/lang/String;
    const-string v8, "_data"

    invoke-virtual {v7, v8, v6}, Landroid/content/ContentValues;->put(Ljava/lang/String;Ljava/lang/String;)V

    .line 248
    .end local v6           #value:Ljava/lang/String;
    :cond_2
    sget-object v8, Lcom/htc/android/footprints/utils/camera/FootprintImageManager;->sStorageURI:Landroid/net/Uri;

    invoke-virtual {p1, v8, v7}, Landroid/content/ContentResolver;->insert(Landroid/net/Uri;Landroid/content/ContentValues;)Landroid/net/Uri;

    move-result-object v5

    .line 265
    .local v5, uri:Landroid/net/Uri;
    return-object v5
.end method

.method public declared-synchronized cachedScaledFastImage(Ljava/lang/String;IILjava/lang/String;)Z
    .locals 9
    .parameter "tag"
    .parameter "width"
    .parameter "height"
    .parameter "filePath"

    .prologue
    const-string v7, "_"

    .line 544
    monitor-enter p0

    const/4 v2, 0x0

    .line 547
    .local v2, isSuccess:Z
    :try_start_0
    new-instance v7, Ljava/lang/StringBuilder;

    invoke-direct {v7}, Ljava/lang/StringBuilder;-><init>()V

    invoke-virtual {v7, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v7

    const-string v8, "_"

    invoke-virtual {v7, v8}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v7

    invoke-virtual {v7, p2}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v7

    const-string v8, "_"

    invoke-virtual {v7, v8}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v7

    invoke-virtual {v7, p3}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v7

    const-string v8, "_"

    invoke-virtual {v7, v8}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v7

    invoke-virtual {v7, p4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v7

    invoke-virtual {v7}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v3

    .line 548
    .local v3, key:Ljava/lang/String;
    iget-object v7, p0, Lcom/htc/android/footprints/utils/camera/FootprintImageManager;->cachedMap:Ljava/util/Map;

    invoke-interface {v7, v3}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v7

    if-nez v7, :cond_0

    .line 549
    new-instance v7, Ljava/io/File;

    invoke-direct {v7, p4}, Ljava/io/File;-><init>(Ljava/lang/String;)V

    invoke-virtual {v7}, Ljava/io/File;->exists()Z
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    move-result v7

    if-eqz v7, :cond_0

    .line 551
    :try_start_1
    new-instance v4, Landroid/graphics/BitmapFactory$Options;

    invoke-direct {v4}, Landroid/graphics/BitmapFactory$Options;-><init>()V

    .line 552
    .local v4, opt:Landroid/graphics/BitmapFactory$Options;
    const/4 v7, 0x0

    iput-boolean v7, v4, Landroid/graphics/BitmapFactory$Options;->inDither:Z

    .line 553
    const/4 v7, 0x0

    iput-boolean v7, v4, Landroid/graphics/BitmapFactory$Options;->inScaled:Z

    .line 554
    const/16 v7, 0x8

    iput v7, v4, Landroid/graphics/BitmapFactory$Options;->inSampleSize:I

    .line 555
    invoke-static {p4, v4}, Landroid/graphics/BitmapFactory;->decodeFile(Ljava/lang/String;Landroid/graphics/BitmapFactory$Options;)Landroid/graphics/Bitmap;

    move-result-object v0

    .line 556
    .local v0, bm:Landroid/graphics/Bitmap;
    if-eqz v0, :cond_1

    .line 558
    const/4 v7, 0x0

    invoke-static {v0, p2, p3, v7}, Landroid/graphics/Bitmap;->createScaledBitmap(Landroid/graphics/Bitmap;IIZ)Landroid/graphics/Bitmap;

    move-result-object v6

    .line 560
    .local v6, tmp:Landroid/graphics/Bitmap;
    invoke-virtual {v0}, Landroid/graphics/Bitmap;->recycle()V

    .line 561
    new-instance v5, Lcom/htc/android/footprints/utils/camera/FootprintImageManager$FastBitmapDrawable;

    invoke-direct {v5, v6}, Lcom/htc/android/footprints/utils/camera/FootprintImageManager$FastBitmapDrawable;-><init>(Landroid/graphics/Bitmap;)V

    .line 562
    .local v5, result:Lcom/htc/android/footprints/utils/camera/FootprintImageManager$FastBitmapDrawable;
    iget-object v7, p0, Lcom/htc/android/footprints/utils/camera/FootprintImageManager;->cachedMap:Ljava/util/Map;

    invoke-interface {v7, v3, v5}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_0
    .catch Ljava/lang/Exception; {:try_start_1 .. :try_end_1} :catch_0

    .line 566
    .end local v6           #tmp:Landroid/graphics/Bitmap;
    :goto_0
    const/4 v2, 0x1

    .line 572
    .end local v0           #bm:Landroid/graphics/Bitmap;
    .end local v4           #opt:Landroid/graphics/BitmapFactory$Options;
    .end local v5           #result:Lcom/htc/android/footprints/utils/camera/FootprintImageManager$FastBitmapDrawable;
    :cond_0
    :goto_1
    monitor-exit p0

    return v2

    .line 564
    .restart local v0       #bm:Landroid/graphics/Bitmap;
    .restart local v4       #opt:Landroid/graphics/BitmapFactory$Options;
    :cond_1
    const/4 v5, 0x0

    .restart local v5       #result:Lcom/htc/android/footprints/utils/camera/FootprintImageManager$FastBitmapDrawable;
    goto :goto_0

    .line 567
    .end local v0           #bm:Landroid/graphics/Bitmap;
    .end local v4           #opt:Landroid/graphics/BitmapFactory$Options;
    .end local v5           #result:Lcom/htc/android/footprints/utils/camera/FootprintImageManager$FastBitmapDrawable;
    :catch_0
    move-exception v7

    move-object v1, v7

    .line 568
    .local v1, e:Ljava/lang/Exception;
    goto :goto_1

    .line 544
    .end local v1           #e:Ljava/lang/Exception;
    .end local v3           #key:Ljava/lang/String;
    :catchall_0
    move-exception v7

    monitor-exit p0

    throw v7
.end method

.method public declared-synchronized clearCache(Ljava/lang/String;)V
    .locals 7
    .parameter "tag"

    .prologue
    const-string v3, "FootprintImageManager"

    .line 515
    monitor-enter p0

    :try_start_0
    const-string v3, "FootprintImageManager"

    new-instance v4, Ljava/lang/StringBuilder;

    invoke-direct {v4}, Ljava/lang/StringBuilder;-><init>()V

    const-string v5, "Howard - before clear cache:"

    invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v4

    invoke-static {}, Ldalvik/system/VMRuntime;->getRuntime()Ldalvik/system/VMRuntime;

    move-result-object v5

    invoke-virtual {v5}, Ldalvik/system/VMRuntime;->getExternalBytesAllocated()J

    move-result-wide v5

    invoke-virtual {v4, v5, v6}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;

    move-result-object v4

    invoke-virtual {v4}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v4

    invoke-static {v3, v4}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

    .line 516
    iget-object v3, p0, Lcom/htc/android/footprints/utils/camera/FootprintImageManager;->cachedMap:Ljava/util/Map;

    invoke-interface {v3}, Ljava/util/Map;->keySet()Ljava/util/Set;

    move-result-object v3

    invoke-interface {v3}, Ljava/util/Set;->iterator()Ljava/util/Iterator;

    move-result-object v1

    .local v1, i$:Ljava/util/Iterator;
    :cond_0
    :goto_0
    invoke-interface {v1}, Ljava/util/Iterator;->hasNext()Z

    move-result v3

    if-eqz v3, :cond_1

    invoke-interface {v1}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Ljava/lang/String;

    .line 517
    .local v2, key:Ljava/lang/String;
    new-instance v3, Ljava/lang/StringBuilder;

    invoke-direct {v3}, Ljava/lang/StringBuilder;-><init>()V

    invoke-virtual {v3, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    const-string v4, "_"

    invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v2, v3}, Ljava/lang/String;->startsWith(Ljava/lang/String;)Z

    move-result v3

    if-eqz v3, :cond_0

    .line 518
    iget-object v3, p0, Lcom/htc/android/footprints/utils/camera/FootprintImageManager;->cachedMap:Ljava/util/Map;

    invoke-interface {v3, v2}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/htc/android/footprints/utils/camera/FootprintImageManager$FastBitmapDrawable;

    .line 519
    .local v0, bm:Lcom/htc/android/footprints/utils/camera/FootprintImageManager$FastBitmapDrawable;
    if-eqz v0, :cond_0

    .line 520
    iget-object v3, p0, Lcom/htc/android/footprints/utils/camera/FootprintImageManager;->cachedMap:Ljava/util/Map;

    const/4 v4, 0x0

    invoke-interface {v3, v2, v4}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    .line 521
    invoke-virtual {v0}, Lcom/htc/android/footprints/utils/camera/FootprintImageManager$FastBitmapDrawable;->recycle()V
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    goto :goto_0

    .line 515
    .end local v0           #bm:Lcom/htc/android/footprints/utils/camera/FootprintImageManager$FastBitmapDrawable;
    .end local v1           #i$:Ljava/util/Iterator;
    .end local v2           #key:Ljava/lang/String;
    :catchall_0
    move-exception v3

    monitor-exit p0

    throw v3

    .line 525
    .restart local v1       #i$:Ljava/util/Iterator;
    :cond_1
    :try_start_1
    const-string v3, "FootprintImageManager"

    new-instance v4, Ljava/lang/StringBuilder;

    invoke-direct {v4}, Ljava/lang/StringBuilder;-><init>()V

    const-string v5, "Howard - aftr clear cache:"

    invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v4

    invoke-static {}, Ldalvik/system/VMRuntime;->getRuntime()Ldalvik/system/VMRuntime;

    move-result-object v5

    invoke-virtual {v5}, Ldalvik/system/VMRuntime;->getExternalBytesAllocated()J

    move-result-wide v5

    invoke-virtual {v4, v5, v6}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;

    move-result-object v4

    invoke-virtual {v4}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v4

    invoke-static {v3, v4}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    .line 526
    monitor-exit p0

    return-void
.end method

.method public declared-synchronized clearCachebyKeyword(Ljava/lang/String;)V
    .locals 5
    .parameter "keyword"

    .prologue
    .line 530
    monitor-enter p0

    :try_start_0
    iget-object v3, p0, Lcom/htc/android/footprints/utils/camera/FootprintImageManager;->cachedMap:Ljava/util/Map;

    invoke-interface {v3}, Ljava/util/Map;->keySet()Ljava/util/Set;

    move-result-object v3

    invoke-interface {v3}, Ljava/util/Set;->iterator()Ljava/util/Iterator;

    move-result-object v1

    .local v1, i$:Ljava/util/Iterator;
    :cond_0
    invoke-interface {v1}, Ljava/util/Iterator;->hasNext()Z

    move-result v3

    if-eqz v3, :cond_1

    invoke-interface {v1}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Ljava/lang/String;

    .line 531
    .local v2, key:Ljava/lang/String;
    invoke-virtual {v2, p1}, Ljava/lang/String;->indexOf(Ljava/lang/String;)I

    move-result v3

    const/4 v4, -0x1

    if-eq v3, v4, :cond_0

    .line 532
    iget-object v3, p0, Lcom/htc/android/footprints/utils/camera/FootprintImageManager;->cachedMap:Ljava/util/Map;

    invoke-interface {v3, v2}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/htc/android/footprints/utils/camera/FootprintImageManager$FastBitmapDrawable;

    .line 533
    .local v0, bm:Lcom/htc/android/footprints/utils/camera/FootprintImageManager$FastBitmapDrawable;
    if-eqz v0, :cond_1

    .line 534
    iget-object v3, p0, Lcom/htc/android/footprints/utils/camera/FootprintImageManager;->cachedMap:Ljava/util/Map;

    const/4 v4, 0x0

    invoke-interface {v3, v2, v4}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    .line 535
    invoke-virtual {v0}, Lcom/htc/android/footprints/utils/camera/FootprintImageManager$FastBitmapDrawable;->recycle()V
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    .line 540
    .end local v0           #bm:Lcom/htc/android/footprints/utils/camera/FootprintImageManager$FastBitmapDrawable;
    .end local v2           #key:Ljava/lang/String;
    :cond_1
    monitor-exit p0

    return-void

    .line 530
    .end local v1           #i$:Ljava/util/Iterator;
    :catchall_0
    move-exception v3

    monitor-exit p0

    throw v3
.end method

.method public forceWriteToFile(Landroid/content/ContentResolver;Landroid/graphics/Bitmap;Ljava/lang/String;)Z
    .locals 2
    .parameter "cr"
    .parameter "photo"
    .parameter "filename"

    .prologue
    .line 117
    if-eqz p2, :cond_0

    if-eqz p1, :cond_0

    if-nez p3, :cond_1

    :cond_0
    const/4 v0, 0x0

    .line 121
    :goto_0
    return v0

    .line 118
    :cond_1
    new-instance v0, Ljava/lang/StringBuilder;

    invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V

    invoke-static {}, Lcom/htc/android/footprints/utils/camera/FootprintImageManager;->getDirectory()Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    sget-object v1, Ljava/io/File;->separator:Ljava/lang/String;

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0, p3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    invoke-virtual {p0, p2, v0}, Lcom/htc/android/footprints/utils/camera/FootprintImageManager;->writeToFile(Landroid/graphics/Bitmap;Ljava/lang/String;)Z

    .line 120
    invoke-static {p1, p3}, Lcom/htc/android/footprints/utils/FootprintUtils;->forceSync(Landroid/content/ContentResolver;Ljava/lang/String;)V

    .line 121
    const/4 v0, 0x1

    goto :goto_0
.end method

.method public forceWriteToFile(Landroid/content/ContentResolver;[BLjava/lang/String;)Z
    .locals 1
    .parameter "cr"
    .parameter "jpegData"
    .parameter "filename"

    .prologue
    .line 156
    array-length v0, p2

    if-eqz v0, :cond_0

    if-eqz p1, :cond_0

    if-nez p3, :cond_1

    .line 157
    :cond_0
    const/4 v0, 0x0

    .line 160
    :goto_0
    return v0

    .line 158
    :cond_1
    invoke-virtual {p0, p2, p3}, Lcom/htc/android/footprints/utils/camera/FootprintImageManager;->writetoFile([BLjava/lang/String;)Z

    .line 159
    invoke-static {p1, p3}, Lcom/htc/android/footprints/utils/FootprintUtils;->forceSync(Landroid/content/ContentResolver;Ljava/lang/String;)V

    .line 160
    const/4 v0, 0x1

    goto :goto_0
.end method

.method public getImage(Landroid/net/Uri;Landroid/content/Context;)Landroid/graphics/Bitmap;
    .locals 9
    .parameter "uri"
    .parameter "context"

    .prologue
    const v8, 0x7f0200fe

    .line 368
    if-eqz p1, :cond_1

    .line 370
    :try_start_0
    invoke-virtual {p2}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v0

    iget-object v2, p0, Lcom/htc/android/footprints/utils/camera/FootprintImageManager;->projection:[Ljava/lang/String;

    const/4 v3, 0x0

    const/4 v4, 0x0

    const/4 v5, 0x0

    move-object v1, p1

    invoke-virtual/range {v0 .. v5}, Landroid/content/ContentResolver;->query(Landroid/net/Uri;[Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;)Landroid/database/Cursor;

    move-result-object v6

    .line 372
    .local v6, cur:Landroid/database/Cursor;
    invoke-interface {v6}, Landroid/database/Cursor;->getCount()I

    move-result v0

    if-lez v0, :cond_0

    .line 373
    invoke-interface {v6}, Landroid/database/Cursor;->moveToFirst()Z

    .line 375
    const/4 v0, 0x2

    invoke-interface {v6, v0}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;

    move-result-object v0

    invoke-static {v0}, Landroid/graphics/BitmapFactory;->decodeFile(Ljava/lang/String;)Landroid/graphics/Bitmap;

    move-result-object v0

    .line 388
    .end local v6           #cur:Landroid/database/Cursor;
    :goto_0
    return-object v0

    .line 377
    .restart local v6       #cur:Landroid/database/Cursor;
    :cond_0
    invoke-virtual {p2}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;

    move-result-object v0

    const v1, 0x7f0200fe

    invoke-static {v0, v1}, Landroid/graphics/BitmapFactory;->decodeResource(Landroid/content/res/Resources;I)Landroid/graphics/Bitmap;
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    move-result-object v0

    goto :goto_0

    .line 381
    .end local v6           #cur:Landroid/database/Cursor;
    :catch_0
    move-exception v0

    move-object v7, v0

    .line 382
    .local v7, e:Ljava/lang/Exception;
    const-string v0, "FootprintImageManager"

    const-string v1, "getimage error"

    invoke-static {v0, v1}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

    .line 383
    invoke-virtual {p2}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;

    move-result-object v0

    invoke-static {v0, v8}, Landroid/graphics/BitmapFactory;->decodeResource(Landroid/content/res/Resources;I)Landroid/graphics/Bitmap;

    move-result-object v0

    goto :goto_0

    .line 388
    .end local v7           #e:Ljava/lang/Exception;
    :cond_1
    invoke-virtual {p2}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;

    move-result-object v0

    invoke-static {v0, v8}, Landroid/graphics/BitmapFactory;->decodeResource(Landroid/content/res/Resources;I)Landroid/graphics/Bitmap;

    move-result-object v0

    goto :goto_0
.end method

.method public getImage(Ljava/io/File;Landroid/content/Context;)Landroid/graphics/Bitmap;
    .locals 5
    .parameter "file"
    .parameter "context"

    .prologue
    const v4, 0x7f0200fe

    .line 394
    const/4 v0, 0x0

    .line 395
    .local v0, bm:Landroid/graphics/Bitmap;
    if-eqz p1, :cond_0

    invoke-virtual {p1}, Ljava/io/File;->exists()Z

    move-result v2

    if-eqz v2, :cond_0

    .line 397
    :try_start_0
    invoke-virtual {p1}, Ljava/io/File;->getAbsolutePath()Ljava/lang/String;

    move-result-object v2

    invoke-static {v2}, Landroid/graphics/BitmapFactory;->decodeFile(Ljava/lang/String;)Landroid/graphics/Bitmap;

    move-result-object v0

    .line 398
    if-nez v0, :cond_0

    .line 399
    invoke-virtual {p2}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;

    move-result-object v2

    const v3, 0x7f0200fe

    invoke-static {v2, v3}, Landroid/graphics/BitmapFactory;->decodeResource(Landroid/content/res/Resources;I)Landroid/graphics/Bitmap;
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    move-result-object v0

    .line 408
    :cond_0
    :goto_0
    if-nez v0, :cond_1

    .line 409
    invoke-virtual {p2}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;

    move-result-object v2

    invoke-static {v2, v4}, Landroid/graphics/BitmapFactory;->decodeResource(Landroid/content/res/Resources;I)Landroid/graphics/Bitmap;

    move-result-object v0

    .line 412
    :cond_1
    return-object v0

    .line 403
    :catch_0
    move-exception v2

    move-object v1, v2

    .line 404
    .local v1, e:Ljava/lang/Exception;
    const-string v2, "FootprintImageManager"

    invoke-virtual {v1}, Ljava/lang/Exception;->getMessage()Ljava/lang/String;

    move-result-object v3

    invoke-static {v2, v3, v1}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I

    goto :goto_0
.end method

.method public getImagePath(Landroid/net/Uri;Landroid/content/Context;)Ljava/lang/String;
    .locals 9
    .parameter "uri"
    .parameter "context"

    .prologue
    const/4 v8, 0x0

    .line 486
    if-eqz p1, :cond_1

    .line 488
    :try_start_0
    invoke-virtual {p2}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v0

    iget-object v2, p0, Lcom/htc/android/footprints/utils/camera/FootprintImageManager;->projection:[Ljava/lang/String;

    const/4 v3, 0x0

    const/4 v4, 0x0

    const/4 v5, 0x0

    move-object v1, p1

    invoke-virtual/range {v0 .. v5}, Landroid/content/ContentResolver;->query(Landroid/net/Uri;[Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;)Landroid/database/Cursor;

    move-result-object v6

    .line 490
    .local v6, cur:Landroid/database/Cursor;
    invoke-interface {v6}, Landroid/database/Cursor;->getCount()I

    move-result v0

    if-lez v0, :cond_0

    .line 491
    invoke-interface {v6}, Landroid/database/Cursor;->moveToFirst()Z

    .line 492
    const/4 v0, 0x2

    invoke-interface {v6, v0}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    move-result-object v0

    .line 501
    .end local v6           #cur:Landroid/database/Cursor;
    :goto_0
    return-object v0

    .restart local v6       #cur:Landroid/database/Cursor;
    :cond_0
    move-object v0, v8

    .line 494
    goto :goto_0

    .line 497
    .end local v6           #cur:Landroid/database/Cursor;
    :catch_0
    move-exception v0

    move-object v7, v0

    .local v7, e:Ljava/lang/Exception;
    move-object v0, v8

    .line 498
    goto :goto_0

    .end local v7           #e:Ljava/lang/Exception;
    :cond_1
    move-object v0, v8

    .line 501
    goto :goto_0
.end method

.method public declared-synchronized getScaledFastImage(Ljava/lang/String;Ljava/lang/String;II)Landroid/graphics/drawable/Drawable;
    .locals 8
    .parameter "tag"
    .parameter "filepath"
    .parameter "width"
    .parameter "height"

    .prologue
    const-string v6, "_"

    .line 578
    monitor-enter p0

    if-eqz p2, :cond_0

    :try_start_0
    const-string v6, ""

    invoke-virtual {p2, v6}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    move-result v6

    if-eqz v6, :cond_1

    .line 579
    :cond_0
    const/4 v6, 0x0

    .line 617
    :goto_0
    monitor-exit p0

    return-object v6

    .line 581
    :cond_1
    :try_start_1
    new-instance v6, Ljava/lang/StringBuilder;

    invoke-direct {v6}, Ljava/lang/StringBuilder;-><init>()V

    invoke-virtual {v6, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v6

    const-string v7, "_"

    invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v6

    invoke-virtual {v6, p3}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v6

    const-string v7, "_"

    invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v6

    invoke-virtual {v6, p4}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v6

    const-string v7, "_"

    invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v6

    invoke-virtual {v6, p2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v6

    invoke-virtual {v6}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v2

    .line 582
    .local v2, key:Ljava/lang/String;
    iget-object v6, p0, Lcom/htc/android/footprints/utils/camera/FootprintImageManager;->cachedMap:Ljava/util/Map;

    invoke-interface {v6, v2}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v4

    check-cast v4, Lcom/htc/android/footprints/utils/camera/FootprintImageManager$FastBitmapDrawable;

    .line 585
    .local v4, result:Lcom/htc/android/footprints/utils/camera/FootprintImageManager$FastBitmapDrawable;
    if-nez v4, :cond_2

    .line 587
    new-instance v6, Ljava/io/File;

    invoke-direct {v6, p2}, Ljava/io/File;-><init>(Ljava/lang/String;)V

    invoke-virtual {v6}, Ljava/io/File;->exists()Z
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    move-result v6

    if-eqz v6, :cond_3

    .line 589
    :try_start_2
    new-instance v3, Landroid/graphics/BitmapFactory$Options;

    invoke-direct {v3}, Landroid/graphics/BitmapFactory$Options;-><init>()V

    .line 590
    .local v3, opt:Landroid/graphics/BitmapFactory$Options;
    const/4 v6, 0x0

    iput-boolean v6, v3, Landroid/graphics/BitmapFactory$Options;->inDither:Z

    .line 591
    const/4 v6, 0x0

    iput-boolean v6, v3, Landroid/graphics/BitmapFactory$Options;->inScaled:Z

    .line 592
    const/16 v6, 0x8

    iput v6, v3, Landroid/graphics/BitmapFactory$Options;->inSampleSize:I

    .line 594
    invoke-static {p2, v3}, Landroid/graphics/BitmapFactory;->decodeFile(Ljava/lang/String;Landroid/graphics/BitmapFactory$Options;)Landroid/graphics/Bitmap;
    :try_end_2
    .catchall {:try_start_2 .. :try_end_2} :catchall_0
    .catch Ljava/lang/Exception; {:try_start_2 .. :try_end_2} :catch_0

    move-result-object v0

    .line 603
    .end local v3           #opt:Landroid/graphics/BitmapFactory$Options;
    .local v0, bm:Landroid/graphics/Bitmap;
    :goto_1
    if-eqz v0, :cond_4

    .line 605
    const/4 v6, 0x0

    :try_start_3
    invoke-static {v0, p3, p4, v6}, Landroid/graphics/Bitmap;->createScaledBitmap(Landroid/graphics/Bitmap;IIZ)Landroid/graphics/Bitmap;

    move-result-object v5

    .line 608
    .local v5, tmp:Landroid/graphics/Bitmap;
    invoke-virtual {v0}, Landroid/graphics/Bitmap;->recycle()V

    .line 609
    new-instance v4, Lcom/htc/android/footprints/utils/camera/FootprintImageManager$FastBitmapDrawable;

    .end local v4           #result:Lcom/htc/android/footprints/utils/camera/FootprintImageManager$FastBitmapDrawable;
    invoke-direct {v4, v5}, Lcom/htc/android/footprints/utils/camera/FootprintImageManager$FastBitmapDrawable;-><init>(Landroid/graphics/Bitmap;)V

    .line 610
    .restart local v4       #result:Lcom/htc/android/footprints/utils/camera/FootprintImageManager$FastBitmapDrawable;
    iget-object v6, p0, Lcom/htc/android/footprints/utils/camera/FootprintImageManager;->cachedMap:Ljava/util/Map;

    invoke-interface {v6, v2, v4}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
    :try_end_3
    .catchall {:try_start_3 .. :try_end_3} :catchall_0

    .end local v0           #bm:Landroid/graphics/Bitmap;
    .end local v5           #tmp:Landroid/graphics/Bitmap;
    :cond_2
    :goto_2
    move-object v6, v4

    .line 617
    goto :goto_0

    .line 595
    :catch_0
    move-exception v6

    move-object v1, v6

    .line 596
    .local v1, e:Ljava/lang/Exception;
    const/4 v0, 0x0

    .line 597
    .restart local v0       #bm:Landroid/graphics/Bitmap;
    goto :goto_1

    .line 601
    .end local v0           #bm:Landroid/graphics/Bitmap;
    .end local v1           #e:Ljava/lang/Exception;
    :cond_3
    const/4 v0, 0x0

    .restart local v0       #bm:Landroid/graphics/Bitmap;
    goto :goto_1

    .line 612
    :cond_4
    const/4 v4, 0x0

    goto :goto_2

    .line 578
    .end local v0           #bm:Landroid/graphics/Bitmap;
    .end local v2           #key:Ljava/lang/String;
    .end local v4           #result:Lcom/htc/android/footprints/utils/camera/FootprintImageManager$FastBitmapDrawable;
    :catchall_0
    move-exception v6

    monitor-exit p0

    throw v6
.end method

.method public getScaledImage(Landroid/graphics/Bitmap;Ljava/io/File;Landroid/content/Context;IIIZ)Landroid/graphics/Bitmap;
    .locals 7
    .parameter "destBitmap"
    .parameter "file"
    .parameter "context"
    .parameter "w"
    .parameter "h"
    .parameter "sample"
    .parameter "filter"

    .prologue
    const v6, 0x7f0200fe

    const/4 v4, 0x0

    .line 450
    const/4 v0, 0x0

    .line 451
    .local v0, bm:Landroid/graphics/Bitmap;
    const/4 v2, 0x0

    .line 452
    .local v2, newBmp:Landroid/graphics/Bitmap;
    new-instance v3, Landroid/graphics/BitmapFactory$Options;

    invoke-direct {v3}, Landroid/graphics/BitmapFactory$Options;-><init>()V

    .line 453
    .local v3, opt:Landroid/graphics/BitmapFactory$Options;
    iput-boolean v4, v3, Landroid/graphics/BitmapFactory$Options;->inDither:Z

    .line 454
    iput-boolean v4, v3, Landroid/graphics/BitmapFactory$Options;->inScaled:Z

    .line 455
    iput p6, v3, Landroid/graphics/BitmapFactory$Options;->inSampleSize:I

    .line 457
    if-eqz p2, :cond_0

    invoke-virtual {p2}, Ljava/io/File;->exists()Z

    move-result v4

    if-eqz v4, :cond_0

    .line 460
    :try_start_0
    invoke-virtual {p2}, Ljava/io/File;->getAbsolutePath()Ljava/lang/String;

    move-result-object v4

    invoke-static {v4, v3}, Landroid/graphics/BitmapFactory;->decodeFile(Ljava/lang/String;Landroid/graphics/BitmapFactory$Options;)Landroid/graphics/Bitmap;

    move-result-object v0

    .line 461
    if-nez v0, :cond_0

    .line 462
    invoke-virtual {p3}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;

    move-result-object v4

    const v5, 0x7f0200fe

    invoke-static {v4, v5}, Landroid/graphics/BitmapFactory;->decodeResource(Landroid/content/res/Resources;I)Landroid/graphics/Bitmap;
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    move-result-object v0

    .line 471
    :cond_0
    :goto_0
    if-nez v0, :cond_1

    .line 472
    invoke-virtual {p3}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;

    move-result-object v4

    invoke-static {v4, v6}, Landroid/graphics/BitmapFactory;->decodeResource(Landroid/content/res/Resources;I)Landroid/graphics/Bitmap;

    move-result-object v0

    .line 476
    :cond_1
    invoke-static {p1, v0, p4, p5, p7}, Lcom/htc/android/footprints/utils/camera/FootprintImageManager;->createScaledBitmap(Landroid/graphics/Bitmap;Landroid/graphics/Bitmap;IIZ)Landroid/graphics/Bitmap;

    move-result-object v2

    .line 477
    if-eqz v0, :cond_2

    invoke-virtual {v0}, Landroid/graphics/Bitmap;->recycle()V

    .line 478
    :cond_2
    return-object v2

    .line 465
    :catch_0
    move-exception v4

    move-object v1, v4

    .line 466
    .local v1, e:Ljava/lang/Exception;
    const-string v4, "FootprintImageManager"

    invoke-virtual {v1}, Ljava/lang/Exception;->getMessage()Ljava/lang/String;

    move-result-object v5

    invoke-static {v4, v5, v1}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I

    .line 467
    const/4 v0, 0x0

    goto :goto_0
.end method

.method public getScaledImage(Ljava/io/File;Landroid/content/Context;IIZ)Landroid/graphics/Bitmap;
    .locals 7
    .parameter "file"
    .parameter "context"
    .parameter "w"
    .parameter "h"
    .parameter "filter"

    .prologue
    const v6, 0x7f0200fe

    const/4 v4, 0x0

    .line 417
    const/4 v0, 0x0

    .line 418
    .local v0, bm:Landroid/graphics/Bitmap;
    const/4 v2, 0x0

    .line 419
    .local v2, newBmp:Landroid/graphics/Bitmap;
    new-instance v3, Landroid/graphics/BitmapFactory$Options;

    invoke-direct {v3}, Landroid/graphics/BitmapFactory$Options;-><init>()V

    .line 420
    .local v3, opt:Landroid/graphics/BitmapFactory$Options;
    iput-boolean v4, v3, Landroid/graphics/BitmapFactory$Options;->inDither:Z

    .line 421
    iput-boolean v4, v3, Landroid/graphics/BitmapFactory$Options;->inScaled:Z

    .line 422
    const/4 v4, 0x2

    iput v4, v3, Landroid/graphics/BitmapFactory$Options;->inSampleSize:I

    .line 424
    if-eqz p1, :cond_0

    invoke-virtual {p1}, Ljava/io/File;->exists()Z

    move-result v4

    if-eqz v4, :cond_0

    .line 427
    :try_start_0
    invoke-virtual {p1}, Ljava/io/File;->getAbsolutePath()Ljava/lang/String;

    move-result-object v4

    invoke-static {v4, v3}, Landroid/graphics/BitmapFactory;->decodeFile(Ljava/lang/String;Landroid/graphics/BitmapFactory$Options;)Landroid/graphics/Bitmap;

    move-result-object v0

    .line 428
    if-nez v0, :cond_0

    .line 429
    invoke-virtual {p2}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;

    move-result-object v4

    const v5, 0x7f0200fe

    invoke-static {v4, v5}, Landroid/graphics/BitmapFactory;->decodeResource(Landroid/content/res/Resources;I)Landroid/graphics/Bitmap;
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    move-result-object v0

    .line 438
    :cond_0
    :goto_0
    if-nez v0, :cond_1

    .line 439
    invoke-virtual {p2}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;

    move-result-object v4

    invoke-static {v4, v6}, Landroid/graphics/BitmapFactory;->decodeResource(Landroid/content/res/Resources;I)Landroid/graphics/Bitmap;

    move-result-object v0

    .line 442
    :cond_1
    invoke-static {v0, p3, p4, p5}, Landroid/graphics/Bitmap;->createScaledBitmap(Landroid/graphics/Bitmap;IIZ)Landroid/graphics/Bitmap;

    move-result-object v2

    .line 443
    if-eqz v0, :cond_2

    invoke-virtual {v0}, Landroid/graphics/Bitmap;->recycle()V

    .line 445
    :cond_2
    return-object v2

    .line 433
    :catch_0
    move-exception v4

    move-object v1, v4

    .line 434
    .local v1, e:Ljava/lang/Exception;
    const-string v4, "FootprintImageManager"

    invoke-virtual {v1}, Ljava/lang/Exception;->getMessage()Ljava/lang/String;

    move-result-object v5

    invoke-static {v4, v5, v1}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I

    .line 435
    const/4 v0, 0x0

    goto :goto_0
.end method

.method public isCached(Ljava/lang/String;)Z
    .locals 1
    .parameter "key"

    .prologue
    .line 511
    iget-object v0, p0, Lcom/htc/android/footprints/utils/camera/FootprintImageManager;->cachedMap:Ljava/util/Map;

    invoke-interface {v0, p1}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v0

    if-eqz v0, :cond_0

    const/4 v0, 0x1

    :goto_0
    return v0

    :cond_0
    const/4 v0, 0x0

    goto :goto_0
.end method

.method public isCached(Ljava/lang/String;Ljava/lang/String;II)Z
    .locals 4
    .parameter "tag"
    .parameter "filename"
    .parameter "width"
    .parameter "height"

    .prologue
    const-string v3, "_"

    .line 506
    new-instance v1, Ljava/lang/StringBuilder;

    invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V

    invoke-virtual {v1, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    const-string v2, "_"

    invoke-virtual {v1, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1, p3}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v1

    const-string v2, "_"

    invoke-virtual {v1, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1, p4}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v1

    const-string v2, "_"

    invoke-virtual {v1, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1, p2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    .line 507
    .local v0, key:Ljava/lang/String;
    iget-object v1, p0, Lcom/htc/android/footprints/utils/camera/FootprintImageManager;->cachedMap:Ljava/util/Map;

    invoke-interface {v1, v0}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v1

    if-eqz v1, :cond_0

    const/4 v1, 0x1

    :goto_0
    return v1

    :cond_0
    const/4 v1, 0x0

    goto :goto_0
.end method

.method public writeToFile(Landroid/graphics/Bitmap;Ljava/lang/String;)Z
    .locals 6
    .parameter "photo"
    .parameter "savedPhotoPath"

    .prologue
    .line 125
    if-nez p1, :cond_0

    const/4 v4, 0x0

    .line 151
    :goto_0
    return v4

    .line 139
    :cond_0
    const/4 v2, 0x0

    .line 140
    .local v2, fos:Ljava/io/FileOutputStream;
    :try_start_0
    new-instance v1, Ljava/io/File;

    invoke-direct {v1, p2}, Ljava/io/File;-><init>(Ljava/lang/String;)V

    .line 141
    .local v1, file:Ljava/io/File;
    new-instance v3, Ljava/io/FileOutputStream;

    invoke-direct {v3, v1}, Ljava/io/FileOutputStream;-><init>(Ljava/io/File;)V
    :try_end_0
    .catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_0

    .line 142
    .end local v2           #fos:Ljava/io/FileOutputStream;
    .local v3, fos:Ljava/io/FileOutputStream;
    :try_start_1
    sget-object v4, Landroid/graphics/Bitmap$CompressFormat;->JPEG:Landroid/graphics/Bitmap$CompressFormat;

    const/16 v5, 0x55

    invoke-virtual {p1, v4, v5, v3}, Landroid/graphics/Bitmap;->compress(Landroid/graphics/Bitmap$CompressFormat;ILjava/io/OutputStream;)Z

    .line 143
    invoke-virtual {v3}, Ljava/io/FileOutputStream;->flush()V

    .line 144
    invoke-virtual {v3}, Ljava/io/FileOutputStream;->getFD()Ljava/io/FileDescriptor;

    move-result-object v4

    invoke-virtual {v4}, Ljava/io/FileDescriptor;->sync()V

    .line 145
    invoke-virtual {v3}, Ljava/io/FileOutputStream;->close()V
    :try_end_1
    .catch Ljava/io/IOException; {:try_start_1 .. :try_end_1} :catch_1

    .line 151
    .end local v1           #file:Ljava/io/File;
    .end local v3           #fos:Ljava/io/FileOutputStream;
    :goto_1
    const/4 v4, 0x1

    goto :goto_0

    .line 146
    .restart local v2       #fos:Ljava/io/FileOutputStream;
    :catch_0
    move-exception v4

    move-object v0, v4

    .line 147
    .local v0, e:Ljava/io/IOException;
    :goto_2
    const-string v4, "FootprintImageManager"

    const-string v5, "write photo to external storage error!"

    invoke-static {v4, v5}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I

    .line 148
    invoke-virtual {v0}, Ljava/io/IOException;->printStackTrace()V

    goto :goto_1

    .line 146
    .end local v0           #e:Ljava/io/IOException;
    .end local v2           #fos:Ljava/io/FileOutputStream;
    .restart local v1       #file:Ljava/io/File;
    .restart local v3       #fos:Ljava/io/FileOutputStream;
    :catch_1
    move-exception v4

    move-object v0, v4

    move-object v2, v3

    .end local v3           #fos:Ljava/io/FileOutputStream;
    .restart local v2       #fos:Ljava/io/FileOutputStream;
    goto :goto_2
.end method

.method public writetoFile([BLjava/lang/String;)Z
    .locals 6
    .parameter "jpegData"
    .parameter "filename"

    .prologue
    .line 172
    if-eqz p1, :cond_0

    .line 185
    const/4 v1, 0x0

    .line 187
    .local v1, file:Ljava/io/File;
    :try_start_0
    new-instance v2, Ljava/io/File;

    new-instance v4, Ljava/lang/StringBuilder;

    invoke-direct {v4}, Ljava/lang/StringBuilder;-><init>()V

    invoke-static {}, Lcom/htc/android/footprints/utils/camera/FootprintImageManager;->getDirectory()Ljava/lang/String;

    move-result-object v5

    invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v4

    sget-object v5, Ljava/io/File;->separator:Ljava/lang/String;

    invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v4

    invoke-virtual {v4, p2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v4

    invoke-virtual {v4}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v4

    invoke-direct {v2, v4}, Ljava/io/File;-><init>(Ljava/lang/String;)V
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    .line 188
    .end local v1           #file:Ljava/io/File;
    .local v2, file:Ljava/io/File;
    :try_start_1
    new-instance v3, Ljava/io/FileOutputStream;

    invoke-direct {v3, v2}, Ljava/io/FileOutputStream;-><init>(Ljava/io/File;)V

    .line 189
    .local v3, fos:Ljava/io/FileOutputStream;
    invoke-virtual {v3, p1}, Ljava/io/FileOutputStream;->write([B)V

    .line 190
    invoke-virtual {v3}, Ljava/io/FileOutputStream;->flush()V

    .line 191
    invoke-virtual {v3}, Ljava/io/FileOutputStream;->getFD()Ljava/io/FileDescriptor;

    move-result-object v4

    invoke-virtual {v4}, Ljava/io/FileDescriptor;->sync()V

    .line 192
    invoke-virtual {v3}, Ljava/io/FileOutputStream;->close()V
    :try_end_1
    .catch Ljava/lang/Exception; {:try_start_1 .. :try_end_1} :catch_1

    .line 198
    .end local v2           #file:Ljava/io/File;
    .end local v3           #fos:Ljava/io/FileOutputStream;
    :cond_0
    :goto_0
    const/4 v4, 0x1

    return v4

    .line 194
    .restart local v1       #file:Ljava/io/File;
    :catch_0
    move-exception v4

    move-object v0, v4

    .line 195
    .local v0, e:Ljava/lang/Exception;
    :goto_1
    const-string v4, "FootprintImageManager"

    invoke-virtual {v0}, Ljava/lang/Exception;->toString()Ljava/lang/String;

    move-result-object v5

    invoke-static {v4, v5}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I

    goto :goto_0

    .line 194
    .end local v0           #e:Ljava/lang/Exception;
    .end local v1           #file:Ljava/io/File;
    .restart local v2       #file:Ljava/io/File;
    :catch_1
    move-exception v4

    move-object v0, v4

    move-object v1, v2

    .end local v2           #file:Ljava/io/File;
    .restart local v1       #file:Ljava/io/File;
    goto :goto_1
.end method
